home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / powerd / lib / startup.ass < prev    next >
Encoding:
Text File  |  1980-12-11  |  1.1 KB  |  60 lines

  1. _START    move.l    a0,_arg
  2.     clr.b    (-1,a0,d0.w)
  3.     movea.l    $4.w,a6
  4.     lea    (DOSName,pc),a1
  5.     moveq    #37,d0
  6.     jsr    (-552,a6)        ; OpenLibrary()
  7.     move.l    d0,_DOSBase
  8.     beq.s    .FINISH
  9.  
  10.     movea.l    d0,a6
  11.     jsr    (-60,a6)        ; Output()
  12.     move.l    d0,_stdout
  13.     jsr    (-54,a6)        ; Input()
  14.     move.l    d0,_stdin
  15.  
  16.     movea.l    $4.w,a6
  17.     lea    (IntName,pc),a1
  18.     moveq    #37,d0
  19.     jsr    (-552,a6)        ; OpenLibrary()
  20.     move.l    d0,_IntuitionBase
  21.     beq.s    .CLOSEDOS
  22.  
  23.     lea    (GfxName,pc),a1
  24.     moveq    #37,d0
  25.     jsr    (-552,a6)        ; OpenLibrary()
  26.     move.l    d0,_GfxBase
  27.     beq.s    .CLOSEINT
  28.  
  29.  
  30.     xref    _main
  31.     jsr    _main        ; a6 is stored
  32.     move.l    d0,d2
  33.  
  34.     movea.l    _GfxBase,a1
  35.     jsr    (-414,a6)        ; CloseLibrary()
  36. .CLOSEINT    movea.l    _IntuitionBase,a1
  37.     jsr    (-414,a6)        ; CloseLibrary()
  38. .CLOSEDOS    movea.l    _DOSBase,a1
  39.     jsr    (-414,a6)        ; CloseLibrary()
  40. .FINISH    move.l    d2,d0
  41.     rts
  42. ****************************************
  43.     xdef    _DOSBase
  44.     xdef    _IntuitionBase
  45.     xdef    _GfxBase
  46.     xdef    _arg
  47.     xdef    _stdout
  48.     xdef    _stdin
  49. ****************************************
  50. _DOSBase        dc.l    0
  51. _IntuitionBase    dc.l    0
  52. _GfxBase        dc.l    0
  53. _arg        dc.l    0
  54. _stdout        dc.l    0
  55. _stdin        dc.l    0
  56. ****************************************
  57. DOSName    dc.b    'dos.library',0
  58. IntName    dc.b    'intuition.library',0
  59. GfxName    dc.b    'graphics.library',0
  60.